package xyz.scootaloo.mono.security.matcher

import org.apache.shiro.authc.AuthenticationInfo
import org.apache.shiro.authc.AuthenticationToken
import org.apache.shiro.authc.credential.CredentialsMatcher
import xyz.scootaloo.mono.security.realm.JwtRealm
import xyz.scootaloo.mono.security.realm.PasswordRealm

/**
 * 不进行匹配的匹配器, 对于所有进行匹配的调用, 一律返回true
 *
 * 因为所有对于权限核对的操作都在Realm中完成了, 所以这里无需再进行匹配
 *
 * @see [PasswordRealm]
 * @see [JwtRealm]
 *
 * @author flutterdash@qq.com
 * @since 2021/7/31 21:37
 */
object DoNotCheckMatcher : CredentialsMatcher {
    override fun doCredentialsMatch(
        token: AuthenticationToken?, info: AuthenticationInfo?
    ): Boolean = true
}
